// var a = 1;
// if(1) {
//     console.log(a);
//     let a = 2;
// }
Parent.prototype.say = function() {
    console.log('hello');
}
function Parent() {
    this.name= 'parent'
}

Child.prototype = new Parent()
function Child() {
    this.age= 18
}

function Child2() {
    Parent.call(this);
    this.age= 19
}

Child3.prototype = new Parent()
function Child3() {
    Parent.call(this)
    this.age= 20
}




let c = new Child()
let c2 = new Child2()
let c3 = new Child3()
console.log(c.name + c.say);
console.log(c2.name + c2.say);
console.log(c3.name + c3.say);